package com.yy.myconfig;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author young
 * @date 2022/12/16 15:49
 * @description: 配置类
 */
@Configuration
public class ApplicationContextConfig {
    /**
     * 配置restTemplate
     */
    @Bean
    //给restTemplate提供负载均衡效果，用于服务建立集群的时候
    @LoadBalanced   
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
